#include <iostream>
#include <string>
using namespace std;

int main() {
  string s1;
  const char *s = "hello world";
  string s2(s);
  cout << "s2 = " << s2 << endl;
  string s3(s2);
  cout << "s3 = " << s3 << endl;
  string s4(10, 'a');
  cout << "s4 = " << s4 << endl;
  //string s5('a',96); 直接转换成asc
  //cout << "s5 = " << s5 << endl;
  string s21;
  s21.assign(s2);
  cout << "s21 = " << s21 << endl;

  string s23;
  s23.assign(s2,5);
  cout << "s23 = " << s23 << endl;

  string s24;
  s24.assign(10, 'c');
  cout << "s24 = " << s24 << endl;
  return 0;
}